package com.chixing.day18_thread;

public class Producer implements Runnable{
    private PubliicResourse publiicResourse;

    public Producer(PubliicResourse publiicResourse) {
        this.publiicResourse = publiicResourse;
    }

    //负责生产面包
    @Override
    public void run() {
        while (true){
            publiicResourse.produce();
            /*try {
                Thread.sleep(2);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }*/
        }

    }
}
